package com.daodway.designpattern.statepattern;

public class MinersWife extends BaseGameEntity {
	private StateMachine<MinersWife> m_pStateMachine;
	public boolean cooking=false;
	public void ChangeState(State<MinersWife> pNewState){
		m_pStateMachine.ChangeState(pNewState);
	}	
	public MinersWife(long id, String entityName) {
		super(id, entityName);
		m_pStateMachine=new StateMachine(this);
		m_pStateMachine.setM_pCurrentState(VisitBathroom.Instance());
		m_pStateMachine.setM_pGlobalState(WifeGlobalState.Instance());
	}

	@Override
	public void update() {
		// TODO Auto-generated method stub
		if(m_pStateMachine!=null){
			m_pStateMachine.Update();
		}
	}

	@Override
	public boolean HandleMessage(Telegram msg) {
		return	m_pStateMachine.HandleMessage(msg);
	}
	public boolean isCooking(){
		boolean flag=false;
		if(cooking){
			flag=cooking;
		}
		return flag;
	}
	public void setCooking(boolean cooking) {
		this.cooking = cooking;
	}
	
}
